#if the following error occured: error while loading shared libraries: liblog4cpp.so.4: cannot open shared object file: No such file or directory
#Do: export  LD_LIBRARY_PATH=/usr/local/lib
#/usr/local/lib is where the log4cpp.so exists

targetFile1=server
targetFile2=client

.PHONY: clean run all

all:  $(targetFile1)  $(targetFile2)

$(targetFile1): $(targetFile1).cpp chat_message.hpp
	g++ $(targetFile1).cpp -o $(targetFile1) -L/usr/local/lib/ -lboost_system-mt
$(targetFile2): $(targetFile2).cpp chat_message.hpp
	g++ $(targetFile2).cpp -o $(targetFile2) -L/usr/local/lib/ -lboost_system-mt -lboost_thread-mt
run:
	./$(targetFile1) &
	./$(targetFile2) localhost

clean:
	rm -f $(targetFile1)  $(targetFile2)
